# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataflow.V1b3.Model.StreamingConfigTask do
  @moduledoc """
  A task that carries configuration information for streaming computations.

  ## Attributes

  *   `commitStreamChunkSizeBytes` (*type:* `String.t`, *default:* `nil`) - Chunk size for commit streams from the harness to windmill.
  *   `getDataStreamChunkSizeBytes` (*type:* `String.t`, *default:* `nil`) - Chunk size for get data streams from the harness to windmill.
  *   `maxWorkItemCommitBytes` (*type:* `String.t`, *default:* `nil`) - Maximum size for work item commit supported windmill storage layer.
  *   `operationalLimits` (*type:* `GoogleApi.Dataflow.V1b3.Model.StreamingOperationalLimits.t`, *default:* `nil`) - Operational limits for the streaming job. Can be used by the worker to validate outputs sent to the backend.
  *   `streamingComputationConfigs` (*type:* `list(GoogleApi.Dataflow.V1b3.Model.StreamingComputationConfig.t)`, *default:* `nil`) - Set of computation configuration information.
  *   `userStepToStateFamilyNameMap` (*type:* `map()`, *default:* `nil`) - Map from user step names to state families.
  *   `userWorkerRunnerV1Settings` (*type:* `String.t`, *default:* `nil`) - Binary encoded proto to control runtime behavior of the java runner v1 user worker.
  *   `userWorkerRunnerV2Settings` (*type:* `String.t`, *default:* `nil`) - Binary encoded proto to control runtime behavior of the runner v2 user worker.
  *   `windmillServiceEndpoint` (*type:* `String.t`, *default:* `nil`) - If present, the worker must use this endpoint to communicate with Windmill Service dispatchers, otherwise the worker must continue to use whatever endpoint it had been using.
  *   `windmillServicePort` (*type:* `String.t`, *default:* `nil`) - If present, the worker must use this port to communicate with Windmill Service dispatchers. Only applicable when windmill_service_endpoint is specified.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :commitStreamChunkSizeBytes => String.t() | nil,
          :getDataStreamChunkSizeBytes => String.t() | nil,
          :maxWorkItemCommitBytes => String.t() | nil,
          :operationalLimits =>
            GoogleApi.Dataflow.V1b3.Model.StreamingOperationalLimits.t() | nil,
          :streamingComputationConfigs =>
            list(GoogleApi.Dataflow.V1b3.Model.StreamingComputationConfig.t()) | nil,
          :userStepToStateFamilyNameMap => map() | nil,
          :userWorkerRunnerV1Settings => String.t() | nil,
          :userWorkerRunnerV2Settings => String.t() | nil,
          :windmillServiceEndpoint => String.t() | nil,
          :windmillServicePort => String.t() | nil
        }

  field(:commitStreamChunkSizeBytes)
  field(:getDataStreamChunkSizeBytes)
  field(:maxWorkItemCommitBytes)
  field(:operationalLimits, as: GoogleApi.Dataflow.V1b3.Model.StreamingOperationalLimits)

  field(:streamingComputationConfigs,
    as: GoogleApi.Dataflow.V1b3.Model.StreamingComputationConfig,
    type: :list
  )

  field(:userStepToStateFamilyNameMap, type: :map)
  field(:userWorkerRunnerV1Settings)
  field(:userWorkerRunnerV2Settings)
  field(:windmillServiceEndpoint)
  field(:windmillServicePort)
end

defimpl Poison.Decoder, for: GoogleApi.Dataflow.V1b3.Model.StreamingConfigTask do
  def decode(value, options) do
    GoogleApi.Dataflow.V1b3.Model.StreamingConfigTask.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataflow.V1b3.Model.StreamingConfigTask do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
